package com.sktlab.bizconfmobile.model;

import com.sktlab.bizconfmobile.util.Util;

public class Participant {
	
	private int contactId;
	private int selectedAttrPosInContactItem = -1;
	private String name;
	private String phone;
	private String email;
	private boolean isModerator;
	//id generated in conference
	private String idInConference;
	//seq number which used to add this participant to a conference
	private int seqNumber;
	
	private boolean isOutCalled;
	
	public Participant() {
		
		name = "null";
		phone = "null";
		email = "null";
		isModerator = false;
		idInConference = "null";
		isOutCalled = false;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
			
		this.phone = phone;	
	}
	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	@Override
	public boolean equals(Object o) {
		
		boolean isEqual = false;
		
		if(o instanceof Participant) {
			
			Participant p = (Participant)o;
			
			if(!Util.isEmpty(p) 
					&& p.getName().equalsIgnoreCase(name) 
					&& p.getPhone().equalsIgnoreCase(phone)
					&& p.getEmail().equalsIgnoreCase(email)){
				
				isEqual = true;
			}
		}
		
		return isEqual;
	}

	public int getSelectedAttrPosInContactItem() {
		return selectedAttrPosInContactItem;
	}

	public void setSelectedAttrPosInContactItem(int selectedAttrPosInContactItem) {
		this.selectedAttrPosInContactItem = selectedAttrPosInContactItem;
	}

	public int getContactId() {
		return contactId;
	}

	public void setContactId(int contactId) {
		this.contactId = contactId;
	}

	public int getSeqNumber() {
		return seqNumber;
	}

	public void setSeqNumber(int seqNumber) {
		this.seqNumber = seqNumber;
	}

	public boolean isModerator() {
		return isModerator;
	}

	public void setIsModerator(boolean isModerator) {
		this.isModerator = isModerator;
	}

	public String getIdInConference() {
		return idInConference;
	}

	public void setIdInConference(String idInConference) {
		this.idInConference = idInConference;
	}

	public boolean isOutCalled() {
		return isOutCalled;
	}

	public void setOutCalled(boolean isOutCalled) {
		this.isOutCalled = isOutCalled;
	}
}
